<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html>
<head>
    <title>首页</title>
</head>
<body>
<%
    Boolean loggedIn = (Boolean) session.getAttribute("loggedIn");
    if (loggedIn != null && loggedIn) {
        String username = (String) session.getAttribute("username");
        out.println("欢迎您，" + username + "！");
    } else {
        out.println("请先登录！");
%>
<jsp:forward page="login.jsp"/>
<%
    }
%>
</body>
</html>